<template>
  <div class="handicap_name">
    <div class="match_type">
      <img v-if="match.sport_type == 'soccer'" src="@/assets/home/football.png" style="width: 14px; height: 14px" alt="" />
      <img v-else src="@/assets/home/basketball.png" style="width: 14px; height: 14px" alt="" />
      <div style="margin-left: 4px;">{{match.sport_type == 'soccer' ? languageJson.home.soccer : languageJson.home.basketball}} - {{match.league_name}}</div>
    </div>
    <div class="name AlibabaPuHuiTi_2_85_">
      <div>{{ dialogState.dialogArr[dataindex].handicapname }}</div>
      <div v-if="props.itemdata.data.pk_type != 'M'">
        <el-input class="ratio_input" v-model="itemdata.data.odds[pkindex].pk_ratio" />
      </div>
    </div>
  </div>
</template>

<script setup>
import { onMounted } from 'vue'

const props = defineProps({
  itemdata: Object,
  dataindex: Number,
  pkindex: Number,
  match: Object
})
const languageJson = inject('languageJson')
const languageType = inject('languageType')

const { dialogStore, dialogState } = inject('DialogStore')



const gettext = () => {
  console.log(props.itemdata);
  
  
  let str = ''
  // if (props.itemdata.data.hf_type == 'full') {
  //   str += '全场'
  // } else if (props.itemdata.data.hf_type == 'half') {
  //   str += '半场'
  // }


  // if (props.itemdata.data.pk_type == 'M') {
  //   str = props.itemdata.data.odds[props.pkindex].odds_name
  // } else if (props.itemdata.data.pk_type == 'R') {
  //   if (props.pkindex == 0) {
  //     str += '主队'
  //   } else {
  //     str += '客队'
  //   }
  //   str += '让球'
  // } else if (props.itemdata.data.pk_type == 'OU') {
  //   if (props.itemdata.data.odds[props.pkindex].odds_name.includes('大')) {
  //     str += '大'
  //   } else {
  //     str += '小'
  //   }
  // }
  return str
}
</script>

<style lang="scss" scoped>
.handicap_name {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(55, 17, 216, 0.08);
}
.match_type {
  display: flex;
  font-family: AlibabaPuHuiTi_2_65_;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
  align-items: center;
}
.name {
  font-family: AlibabaPuHuiTi_2_85_;
  font-size: 14px;
  font-weight: bold;
  color: #000;
  margin-bottom: 8px;
  display: flex;
}
</style>

<style>
.ratio_input {
  width: 60px;
  border-radius: 0;
  height: 24px;
  margin-left: 8px;
}
</style>